using UnityEngine;
using UnityEditor;
using System.Collections;

[CustomEditor(typeof(LevelCreator))]
public class LevelCreatorEditor : BaseEditor
{
	private LevelCreator creator;

	private void OnEnable()
	{
		creator = target as LevelCreator;
	}

	public override void OnInspectorGUI()
	{
		base.OnInspectorGUI();

		if (GUILayout.Button("Create Wall Sprite"))
		{
			creator.CreateWallImage();
		}

		if (GUILayout.Button("Create Tile Connections"))
		{
			creator.CreateTileConnections();
		}

		EditorGUILayout.BeginVertical("box");
		{
			EditorGUILayout.LabelField("Before publishing the game you must : ");
			EditorGUILayout.LabelField("\t- Remove this component from the root");
			EditorGUILayout.LabelField("\t- Set the wall texture to Sprite/UI (and remove the read/write option)");
			EditorGUILayout.LabelField("\t- Delete the GameObject that contains the wall segments");
		}
		EditorGUILayout.EndVertical();

		if (GUI.changed)
		{
			EditorUtility.SetDirty(creator);
		}
	}
}
